package com.briup.day24;

import com.briup.day24.bean.Student;

import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.List;

public class Test_ReadList {
    public static void main(String[] args) throws Exception {
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("01-Basic/src/dir/list.txt"));
        List<Student> list = (List<Student>) ois.readObject();
        if(list==null){
            System.out.println("-------------------------------------------");
            return;
        }
        System.out.println("集合对象个数: "+list.size());
        for(Student s:list){
            System.out.println(s);
        }
        System.out.println("读取完成");
        ois.close();
    }
}
